#ifndef TRMDGRIDBASE_H
#define TRMDGRIDBASE_H

#include <QWidget>
#if _MSC_VER >= 1600
#pragma execution_character_set("utf-8")
#endif

struct  TrKLineStruct
{
    char        datetime[13];
    double      hight;
    double      low;
    double      open;
    double      close;
    int         volume;
};

class CTrMdGridBase : public QWidget
{
    Q_OBJECT
public:
    explicit CTrMdGridBase(QWidget *parent = nullptr);

signals:

public slots:

protected:
    virtual void changeEvent(QEvent* event) override;
    virtual void resizeEvent(QResizeEvent *event) override;
    // functions
    void    drawBaseLine(QPainter* painter);
    void    updateWidgetSize();

    // vars
    int     iWidth      =   0;
    int     iHight      =   0;
    int     iLeftWidth  =   45;
    int     iTopHight   =   30;
    int     iBotHight   =   100;
    int     iRightWidth =   45;
    QColor  coRed       =   QColor(220, 61, 61);
    QColor  coRedBlk    =   QColor(100, 30, 30);
    QColor  coGreen     =   QColor(0, 200, 102);
    //QColor  coBgb       =   QColor(20, 20, 20);
    QColor  coGray      =   QColor(150, 150, 150);
    QColor  coYell      =   QColor(255, 246, 143);
    QSize   m_SizeOne;
    QString InstrumentID;
public:
    void    SetInstrument(QString Instrument);
    QSize   getBlockSize();
    double  m_maxPrice  =   0.00;
    double  m_minPrice  =   0.00;
};

#endif // TRMDGRIDBASE_H
